const adaptive = function (Vue) {
    Vue.directive('adaptive', {
        inserted: function (el) {
            Vue.nextTick(_ => {
                const dialogDom = el.querySelector('.el-dialog')
                const dialogBodyDom = el.querySelector('.el-dialog__body')
                const rec = document.body.getBoundingClientRect()
                const device = rec.width - 1 < 992 ? 'mobile' : 'pc'
                if (device === 'mobile') {
                    if(dialogDom)dialogDom.style.cssText += 'width:95% !important'
					if(dialogBodyDom)dialogBodyDom.style.cssText += `padding:10px !important;`
                    
                }
            })
        }
    })
}

export default adaptive